using System;
using System.Collections.Generic;
using System.Text;
using DTO;

namespace DAO
{
    public class InventStoreDAO
    {
        // them hang` moi vao kho (man` hinh` 2)
        public void InsertInventoryStore(InventStore inventStore)
        {
            DataProvider provider = new DataProvider();
            provider.Open();
            string command = "insert into DMS_InvtStore(InvtID, SitID, StoreQty) values ("
                + inventStore.InvId + "," + inventStore.SiteId + "," + inventStore.StoreQty + ")";

            provider.ExcuteNonQuery(command);
            provider.Close();
        }

        // them hang` co san~ vao` kho (man` hinh` 2)
        public void UpdateInventoryStore(int invtID, int siteID, int quanty)
        {
            DataProvider provider = new DataProvider();
            provider.Open();
            string command = "update DMS_InvtStore set StoreQty = StoreQty + " + quanty + "where InvtID = " + invtID + "AND SiteID = " + siteID;

            provider.ExcuteNonQuery(command);
            provider.Close();
        }
    }
}
